package com.regtwo.admin.sqlapp;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by 39466 on 2016/3/20.
 */
public class SqlAppHelper extends SQLiteOpenHelper {


    public SqlAppHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    /**
     * 创建表
     * @param db
     */
    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table users (id integer primary key autoincrement,uname text)";
        db.execSQL(sql);

    }

    /**
     * 表结构改变的时候用;
     * @param db
     * @param oldVersion
     * @param newVersion
     */
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
